<template>
  <van-nav-bar title="分类数据" left-text="" left-arrow @click-left="
    () => {
      $router.push('/');
    }
  " fixed />
  <div style="height: 45px"></div>
  <router-link v-for="item in claListData" :key="item.goods_id"
    :to="{ name: 'detail', params: { goods_id: item.goods_id } }">
    <van-card :price="item.goods_price" :title="item.goods_name" :thumb="item.goods_small_logo ||
      'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'
      " />
  </router-link>
</template>

<script setup>
import { ref } from "vue";
import { useRoute } from "vue-router";
const route = useRoute();
import { getClaListApi } from "@/api/api";
const claListData = ref({});
getClaListApi(route.params.cat_name).then((res) => {
  console.log("res: ", res);
  claListData.value = res.data.message.goods;
});
</script>

<style></style>
